﻿package mortal.game.view.copy.crossMainCity.panels.sub
{
    import com.mui.controls.*;
    import com.mui.utils.*;
    import mortal.common.*;
    import mortal.common.global.*;
    import mortal.game.resource.*;
    import mortal.game.view.common.*;
    import mortal.game.view.task.view.*;

    public class MainCityRankTotalBg extends GSprite
    {
        private var _bg:GImageBitmap;
        private var _txtGuildName:GTextFiled;
        private var _bmpGuildScore:GImageBitmap;
        private var _txtGuildScore:GTextFiled;
        private var _bmpMyScore:GImageBitmap;
        private var _txtMyScore:GTextFiled;
        private var _rewards:TaskReward;

        public function MainCityRankTotalBg()
        {
            return;
        }// end function

        public function updateDatas(param1:Boolean, param2:Boolean, param3:String, param4:int, param5:int, param6:Array) : void
        {
            if (param2)
            {
                this._bg.imgUrl = ImagesConst.MainCityBattleSuccessBg;
            }
            else
            {
                this._bg.imgUrl = ImagesConst.MainCityBattleFailBg;
            }
            if (param1)
            {
                this._bmpMyScore.imgUrl = ImagesConst.MainCityBattle_WDRY;
                this._bmpGuildScore.imgUrl = ImagesConst.MainCityBattle_SJ;
            }
            else
            {
                this._bmpMyScore.imgUrl = ImagesConst.MainCityBattle_WDGX;
                this._bmpGuildScore.imgUrl = ImagesConst.MainCityBattle_JF;
            }
            this._txtGuildName.text = param3;
            this._txtGuildScore.text = param4.toString();
            this._txtMyScore.text = param5.toString();
            this._rewards.updateRewards(param6);
            this._rewards.setNumYPlace(25);
            return;
        }// end function

        override public function get height() : Number
        {
            return 63;
        }// end function

        public function set isSuccess(param1:Boolean) : void
        {
            if (param1)
            {
                this._bg.imgUrl = ImagesConst.MainCityBattleSuccessBg;
            }
            else
            {
                this._bg.imgUrl = ImagesConst.MainCityBattleFailBg;
            }
            return;
        }// end function

        override protected function createDisposedChildrenImpl() : void
        {
            super.createDisposedChildrenImpl();
            this._bg = UIFactory.gImageBitmap(ImagesConst.MainCityBattleSuccessBg, 0, 0, this);
            var _loc_1:* = GlobalStyle.textFormatBai;
            _loc_1.size = 14;
            this._txtGuildName = UIFactory.gTextField("", 119, 9, 220, 24, this, _loc_1);
            _loc_1 = _loc_1.clone();
            _loc_1.size = 12;
            this._txtGuildScore = UIFactory.gTextField("", 82, 40, 220, 24, this, _loc_1);
            this._bmpGuildScore = UIFactory.gImageBitmap(null, 30, 41, this);
            pushUIToDisposeVec(UIFactory.gImageBitmap(ImagesConst.MainCityBattle_JP, 347, 41, this));
            this._bmpMyScore = UIFactory.gImageBitmap(null, 194, 41, this);
            this._txtMyScore = UIFactory.gTextField("", 262, 40, 220, 24, this, _loc_1.clone());
            this._rewards = UICompomentPool.getUICompoment(TaskReward) as TaskReward;
            this._rewards.x = 395;
            this._rewards.y = 14;
            this.addChild(this._rewards);
            return;
        }// end function

        override protected function disposeImpl(param1:Boolean = true) : void
        {
            super.disposeImpl(param1);
            this._bg.dispose(param1);
            this._bg = null;
            this._txtGuildName.dispose(param1);
            this._txtGuildName = null;
            this._bmpGuildScore.dispose(param1);
            this._bmpGuildScore = null;
            this._txtGuildScore.dispose(param1);
            this._txtGuildScore = null;
            this._bmpMyScore.dispose(param1);
            this._bmpMyScore = null;
            this._txtMyScore.dispose(param1);
            this._txtMyScore = null;
            this._rewards.dispose(param1);
            this._rewards = null;
            return;
        }// end function

    }
}
